#include "Timer.h"

Timer::Timer()
{
	m_currentTime = 0;
	m_ticksPreviousFrame = (float)GetTickCount();
	m_dt = 0;
}

void Timer::UpdateTime()
{
	float ticksCurrentFrame = (float)GetTickCount();
	float diff = ticksCurrentFrame - m_ticksPreviousFrame;

	m_dt = (float)diff * 0.001f;

	m_ticksPreviousFrame = (float)ticksCurrentFrame;

	m_currentTime += m_dt;

	 //       static DWORD dwTimeStart = 0;
  //      DWORD dwTimeCur = GetTickCount();
  //      if( dwTimeStart == 0 )
  //          dwTimeStart = dwTimeCur;

		//static float curTime = 0;
  //      curTime = ( dwTimeCur - dwTimeStart ) / 1000.0f;

}

float Timer::GetTime()
{
	return m_currentTime;
}

float Timer::GetDt()
{
	return m_dt;
}